//jQuery Truncate Text Plugin
//Owain Lewis
//URL: www.owainlewis.com

(function($){

	$.fn.extend({ 
		truncate: function(options) {

			var defaults = {
				limit:200,
				delimiter:'...'
			};
			
			var options = $.extend(defaults, options);
			
			//Add a custom method to Javascript String
			String.prototype.trunc = function(n) {
				return this.substr(0, n - 1) + (this.length > n ? options.delimiter : '');
			};

			return this.each(function(limit) {
				var obj = jQuery(this);
				string = jQuery(this).html();
				newString = string.trunc(options.limit);
				obj.html(newString);
			});
		}
	});
})(jQuery);


$('document').ready(function(){
	jQuery('.shortenMe').truncate({
		limit:200,
		delimiter:'... '
});

jQuery('.shortenMeAdrarGreinar').truncate({
    limit: 200,
    delimiter: '...'
});

jQuery('.shortenMeIndex').truncate({
    limit: 250,
    delimiter: '...'
});


});



